(1) Field of the Invention
The present invention relates to a technique for demultiplexing multiplexed data to pieces of encoded data. In the multiplexed data, a plurality of types of encoded data are multiplexed, for example.
(2) Description of the Related Art
In recent years, digital apparatuses that play back audio, video and additional information such as subtitles have been widely used. As common in DVDs (Digital Versatile Disks), digital broadcast system and so on, the audio data, the video data and the additional information data are digital-encoded and multiplexed. The digital apparatuses receive the multiplexed data via wires or wirelessly, and demultiplexes the multiplexed data to play back audio, video and additional information.
Generally, for encoding video data, the encoding method defined by the MPEG (Moving Picture Expert Group) standard is used. For encoding audio data, other encoding method may be adopted as well as the encoding method defined by the MPEG standard.
For multiplexing audio encoded data, video encoded data and encoded additional information data, the multiplex system defined by the system standard of the MPEG is generally used.
With the digital apparatuses described above, an error might be mixed in the multiplexed data during the encoding or transmission through a transmission path. Therefore, there is a demand for a digital apparatus that can smoothly play back images, sounds, etc. of such deteriorated multiplexed data.
Firstly, for explaining a conventional art attempting to fulfill the above demand, an example of a schematic structure of multiplexed data to be accumulated is shown in FIG. 12. In this example, the data is multiplexed in accordance with the multiplex system defined by the system standard of the MPEG.
A PES (Packetized Elementary Stream) illustrated in FIG. 12 is a variable-length packet divided from an ES (elementary Stream) so as to have a certain length and packetized. The PES includes a PES header and a PES payload.
The PES header includes a packet start code at the head thereof, which includes a packet start code prefix as a fixed value and a stream ID (identifier) representing a stream type (video, audio, additional information, etc.). The packet start code indicates the head of the PES. The PES header also includes PES header information, which follows the packet start code. The PES header information includes, for example, information representing a PES packet length and PES header data length, a flag, and control information.
The control information includes, for example, time stamp information which designates a playback start time of encoded data to be inserted in the PES payload. As the time stamp information, two types are defined. One is a PTS (Presentation Time Stamp) which indicates a presentation time, and the other is a DTS (Decoding Time Stamp) which indicates a decoding time.
A pack illustrated in FIG. 12 includes the pack header and the PES. The pack header includes a pack start code at the head thereof, which is a unique data sequence. The pack start code indicates the head of the pack. The pack header also includes pack header information, which follows the pack start code. The pack header information includes, for example, an SCR (System Clock Reference) and rate (speed) information.
A PS (program stream) illustrated in FIG. 12 includes a plurality of the packs.
Next, the conventional art attempting to fulfill the demand above is described. Note that each of the pack start code indicating the head of the pack and the packet start code indicating the head of the PES is a unique sequence of values. Such a sequence is hereinafter called the “unique pattern”.
A search for the unique pattern is conducted in the forward direction of the program stream.
If a pattern data sequence that is the same as the unique pattern is found by the search, header information is extracted from a data sequence that follows the found pattern data sequence (hereinafter called a “pattern subsequent data sequence”) and whether any error is included in the extracted header information (hereinafter called “extraction header information”) is judged. If any error is detected in the extraction header information, skip-reading of data based on the header length and the packet length is not performed. Instead, the search for the unique pattern is resumed from the head of a data sequence (hereinafter called “header subsequent data sequence”) that follows the extraction header information in the forward direction of the program stream (e.g. Japanese Laid-open Patent Application Publication No. 2000-40311).
The following explains problems of the above-described conventional art, with reference to FIG. 13. FIG. 13 is a drawing for explaining the problems of the conventional art.
(A) A digital apparatus searches for the unique pattern in the forward direction of the program stream, and detects a pattern data sequence (a unique pattern UP0) that is the same as the unique pattern.
(B) The Digital apparatus extracts header information HD0 from a pattern subsequent data sequence following the detected unique pattern UP0. The digital apparatus judges whether any error is included in the header information HD0, and detects an error of the header information HD0.
(C) The digital apparatus conducts a search for the unique pattern in the forward direction of the program stream from a position of the head of a header subsequent data sequence following the header information HD0, and detects a pattern data sequence (a pseudo unique pattern PUP) that is the same as the unique pattern included in the encoded data.
(D) The digital apparatus extracts pseudo header information PHD as the header information from a pattern subsequent data sequence following the detected pseudo unique pattern PUP, and judges whether any error is included in the pseudo header information PHD. The pseudo unique pattern PUP is a data sequence in encoded data, but not the genuine unique pattern. Also, the pseudo header information PHD extracted from the pattern subsequent data sequence following the pseudo unique pattern PUP is not the genuine header information. For this reason, the digital apparatus detects an error of the pseudo header information PHD.
(E) The digital apparatus conducts a search for the unique pattern in the forward direction of the program stream from a position of the head of a header subsequent data sequence following the pseudo header information PHD, and detects a pattern data sequence (a unique pattern UP2) that is the same as the unique pattern.
The unique pattern UP2 is a genuine unique pattern.
(F) The digital apparatus extracts header information HD2 from a pattern subsequent data sequence following the detected unique pattern UP2. The digital apparatus judges whether any error is included in the header information HD2, and does not detect an error of the header information.
In the example of FIG. 13, the program stream includes the genuine unique pattern UP1 and the header information HD1 that includes no error. However, since the search for the unique pattern is resumed from the position of the head of the header subsequent data sequence following the pseudo header information PHD, the unique pattern UP1 is undetectable.
Thus, if at least part of the genuine unique pattern is included in the pseudo header information, the digital apparatus of the conventional art can not detects the genuine unique pattern. For this reason, the digital apparatus can not perform reproduction of the encoded data inserted in the PES payload following the genuine unique pattern and the header information that includes no error. This causes some problems. Regarding audio reproduction for example, the sound often jumps, silence continues for a long time, and so on.